package com.rybbaby.tss.platform.sysHandlePermissions.entity;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;
import javax.persistence.Version;

import com.rybbaby.tss.core.utils.StringUtils;
import com.rybbaby.tss.platform.sysAdminUserJoinSysMenuPermissions.entity.SysAdminUserJoinSysMenuPermissions;
import com.rybbaby.tss.platform.sysHandlePermissionsAttrs.entity.SysHandlePermissionsAttrs;
import com.rybbaby.tss.platform.sysHandlePermissionsClasses.entity.SysHandlePermissionsClasses;
import com.rybbaby.tss.platform.sysHandlePermissionsEvents.entity.SysHandlePermissionsEvents;
import com.rybbaby.tss.platform.sysHandlePermissionsStyles.entity.SysHandlePermissionsStyles;
import com.rybbaby.tss.platform.sysMenuPermissions.entity.SysMenuPermissions;
import com.rybbaby.tss.platform.sysRoleJoinSysMenuPermissions.entity.SysRoleJoinSysMenuPermissions;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * @description 操作权限
 * 
 * @author 谢进伟
 * 
 * @createDate 2016-11-26 下午1:38:47
 */
@Entity
@Table(name = "sys_handle_permissions")
@DynamicUpdate(true)
@DynamicInsert(true)
public class SysHandlePermissions implements Serializable {
	
	private static final long serialVersionUID = 19000794334895L;
	
	/** 主键 **/
	private String id;
	/** 所属默认操作权限 **/
	private String defaultHandlePermissionId;
	/** 用户菜单权限分配Id **/
	private String adminUserPermissionAllotId;
	/** 角色菜单权限分配Id **/
	private String rolePermissionAllotId;
	/** 菜单权限id **/
	private String menuId;
	/** 权限名称 **/
	private String name;
	/** 批量 **/
	private String pageName;
	/** 权限编码 **/
	private String code;
	/** 标签名 **/
	private String tagName;
	/** 内部html **/
	private String innerHtml;
	/** ID属性 **/
	private String idAttr;
	/** 权重 **/
	private Integer weight;
	/** 是否禁用 **/
	private Boolean isForbidden;
	/** 创建时间 **/
	private java.sql.Timestamp createTime;
	/** 创建人Id **/
	private String createUserId;
	/** 版本 **/
	private Integer version;
	/** 用户菜单权限分配Id **/
	private SysAdminUserJoinSysMenuPermissions adminUserPermissionAllot;
	/** 角色菜单权限分配Id **/
	private SysRoleJoinSysMenuPermissions rolePermissionAllot;
	/** 菜单权限id **/
	private SysMenuPermissions sysMenuPermissions;
	
	/** 菜单名称 **/
	private String menuName;
	/** 菜单的全校标识 **/
	private String handlePermissionIdentifier;
	/** 加载所有的操作权限Class属性 **/
	private List<SysHandlePermissionsClasses> classes = new ArrayList<SysHandlePermissionsClasses>();
	/** 加载所有的操作权限style属性 **/
	private List<SysHandlePermissionsStyles> styles = new ArrayList<SysHandlePermissionsStyles>();
	/** 加载所有的操作权限自定义事件 **/
	private List<SysHandlePermissionsEvents> events = new ArrayList<SysHandlePermissionsEvents>();
	/** 加载所有的操作权限自定义属性 **/
	private List<SysHandlePermissionsAttrs> attrs = new ArrayList<SysHandlePermissionsAttrs>();
	
	/**
	 * 方法: 取得用户菜单权限分配Id
	 *
	 * @return SysAdminUserJoinSysMenuPermissions 用户菜单权限分配Id
	 */
	@JoinColumn(name = "adminUserPermissionAllotId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysAdminUserJoinSysMenuPermissions.class)
	public SysAdminUserJoinSysMenuPermissions getAdminUserPermissionAllot() {
		return this.adminUserPermissionAllot;
	}
	
	/**
	 * 方法: 设置用户菜单权限分配Id
	 *
	 * @param adminUserPermissionAllot
	 *            用户菜单权限分配Id
	 */
	public void setAdminUserPermissionAllot(SysAdminUserJoinSysMenuPermissions adminUserPermissionAllot) {
		this.adminUserPermissionAllot = adminUserPermissionAllot;
	}
	
	/**
	 * 方法: 取得角色菜单权限分配Id
	 *
	 * @return SysRoleJoinSysMenuPermissions 角色菜单权限分配Id
	 */
	@JoinColumn(name = "rolePermissionAllotId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysRoleJoinSysMenuPermissions.class)
	public SysRoleJoinSysMenuPermissions getRolePermissionAllot() {
		return this.rolePermissionAllot;
	}
	
	/**
	 * 方法: 设置角色菜单权限分配Id
	 *
	 * @param rolePermissionAllot
	 *            角色菜单权限分配Id
	 */
	public void setRolePermissionAllot(SysRoleJoinSysMenuPermissions rolePermissionAllot) {
		this.rolePermissionAllot = rolePermissionAllot;
	}
	
	@JoinColumn(name = "menuId" , insertable = false , updatable = false)
	@ManyToOne(fetch = FetchType.LAZY , targetEntity = SysMenuPermissions.class)
	public SysMenuPermissions getSysMenuPermissions() {
		return sysMenuPermissions;
	}
	
	public void setSysMenuPermissions(SysMenuPermissions sysMenuPermissions) {
		this.sysMenuPermissions = sysMenuPermissions;
	}
	
	/**
	 * 方法: 取得主键
	 *
	 * @return java.lang.String 主键
	 */
	@Id
	@GeneratedValue(generator = "sys_handle_permissionsIDGenerator" , strategy = GenerationType.AUTO)
	@GenericGenerator(name = "sys_handle_permissionsIDGenerator" , strategy = "uuid")
	@Column(name = "id" , nullable = false , length = 32)
	public String getId() {
		return this.id;
	}
	
	/**
	 * 方法: 设置主键
	 *
	 * @param id
	 *            主键
	 */
	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "defaultHandlePermissionId",nullable = true,length = 32)
	public String getDefaultHandlePermissionId() {
		return defaultHandlePermissionId;
	}

	public void setDefaultHandlePermissionId(String defaultHandlePermissionId) {
		this.defaultHandlePermissionId = defaultHandlePermissionId;
	}

	/**
	 * 方法: 取得用户菜单权限分配Id
	 *
	 * @return java.lang.String 用户菜单权限分配Id
	 */
	@Column(name = "adminUserPermissionAllotId" , nullable = true , length = 32)
	public String getAdminUserPermissionAllotId() {
		return this.adminUserPermissionAllotId;
	}
	
	/**
	 * 方法: 设置用户菜单权限分配Id
	 *
	 * @param adminUserPermissionAllotId
	 *            用户菜单权限分配Id
	 */
	public void setAdminUserPermissionAllotId(String adminUserPermissionAllotId) {
		this.adminUserPermissionAllotId = StringUtils.isBlank(adminUserPermissionAllotId) ? null : adminUserPermissionAllotId;
	}
	
	/**
	 * 方法: 取得角色菜单权限分配Id
	 *
	 * @return java.lang.String 角色菜单权限分配Id
	 */
	@Column(name = "rolePermissionAllotId" , nullable = true , length = 32)
	public String getRolePermissionAllotId() {
		return this.rolePermissionAllotId;
	}
	
	/**
	 * 方法: 设置角色菜单权限分配Id
	 *
	 * @param rolePermissionAllotId
	 *            角色菜单权限分配Id
	 */
	public void setRolePermissionAllotId(String rolePermissionAllotId) {
		this.rolePermissionAllotId = StringUtils.isBlank(rolePermissionAllotId) ? null : rolePermissionAllotId;
	}
	
	@Column(name = "menuId" , nullable = true , length = 32)
	public String getMenuId() {
		return menuId;
	}
	
	public void setMenuId(String menuId) {
		this.menuId = menuId;
	}
	
	/**
	 * 方法: 取得权限名称
	 *
	 * @return java.lang.String 权限名称
	 */
	@Column(name = "name" , nullable = true , length = 50)
	public String getName() {
		return this.name;
	}
	
	/**
	 * 方法: 设置权限名称
	 *
	 * @param name
	 *            权限名称
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * 方法: 取得批量
	 *
	 * @return java.lang.String 批量
	 */
	@Column(name = "pageName" , nullable = true , length = 200)
	public String getPageName() {
		return this.pageName;
	}
	
	/**
	 * 方法: 设置批量
	 *
	 * @param pageName
	 *            批量
	 */
	public void setPageName(String pageName) {
		this.pageName = pageName;
	}
	
	/**
	 * 方法: 取得权限编码
	 *
	 * @return java.lang.String 权限编码
	 */
	@Column(name = "code" , nullable = true , length = 100)
	public String getCode() {
		return this.code;
	}
	
	/**
	 * 方法: 设置权限编码
	 *
	 * @param code
	 *            权限编码
	 */
	public void setCode(String code) {
		this.code = code;
	}
	
	/**
	 * 方法: 取得标签名
	 *
	 * @return java.lang.String 标签名
	 */
	@Column(name = "tagName" , nullable = true , length = 20)
	public String getTagName() {
		return this.tagName;
	}
	
	/**
	 * 方法: 设置标签名
	 *
	 * @param tagName
	 *            标签名
	 */
	public void setTagName(String tagName) {
		this.tagName = tagName;
	}
	
	/**
	 * 方法: 取得内部html
	 *
	 * @return java.lang.String 内部html
	 */
	@Column(name = "innerHtml" , nullable = true , length = 2000)
	public String getInnerHtml() {
		return this.innerHtml;
	}
	
	/**
	 * 方法: 设置内部html
	 *
	 * @param innerHtml
	 *            内部html
	 */
	public void setInnerHtml(String innerHtml) {
		this.innerHtml = innerHtml;
	}
	
	/**
	 * 方法: 取得ID属性
	 *
	 * @return java.lang.String ID属性
	 */
	@Column(name = "idAttr" , nullable = true , length = 500)
	public String getIdAttr() {
		return this.idAttr;
	}
	
	/**
	 * 方法: 设置ID属性
	 *
	 * @param idAttr
	 *            ID属性
	 */
	public void setIdAttr(String idAttr) {
		this.idAttr = idAttr;
	}
	
	/**
	 * 方法: 取得权重
	 *
	 * @return java.lang.Integer 权重
	 */
	@Column(name = "weight" , nullable = true , length = 11)
	public Integer getWeight() {
		return this.weight;
	}
	
	/**
	 * 方法: 设置权重
	 *
	 * @param weight
	 *            权重
	 */
	public void setWeight(Integer weight) {
		this.weight = weight;
	}
	
	/**
	 * 方法: 取得是否禁用
	 *
	 * @return java.lang.Boolean 是否禁用
	 */
	@Column(name = "isForbidden" , nullable = true , length = 1)
	public Boolean getIsForbidden() {
		return this.isForbidden;
	}
	
	/**
	 * 方法: 设置是否禁用
	 *
	 * @param isForbidden
	 *            是否禁用
	 */
	public void setIsForbidden(Boolean isForbidden) {
		this.isForbidden = isForbidden;
	}
	
	/**
	 * 方法: 取得创建时间
	 *
	 * @return java.sql.Timestamp 创建时间
	 */
	@Column(name = "createTime" , nullable = true , length = 19)
	public java.sql.Timestamp getCreateTime() {
		return this.createTime;
	}
	
	/**
	 * 方法: 设置创建时间
	 *
	 * @param createTime
	 *            创建时间
	 */
	public void setCreateTime(java.sql.Timestamp createTime) {
		this.createTime = createTime;
	}
	
	/**
	 * 方法: 取得创建人Id
	 *
	 * @return java.lang.String 创建人Id
	 */
	@Column(name = "createUserId" , nullable = true , length = 32)
	public String getCreateUserId() {
		return this.createUserId;
	}
	
	/**
	 * 方法: 设置创建人Id
	 *
	 * @param createUserId
	 *            创建人Id
	 */
	public void setCreateUserId(String createUserId) {
		this.createUserId = createUserId;
	}
	
	/**
	 * 方法: 取得版本
	 *
	 * @return java.lang.Integer 版本
	 */
	@Version
	@Column(name = "version" , nullable = true , length = 11)
	public Integer getVersion() {
		return this.version;
	}
	
	/**
	 * 方法: 设置版本
	 *
	 * @param version
	 *            版本
	 */
	public void setVersion(Integer version) {
		this.version = version;
	}
	
	@Transient
	public String getMenuName() {
		return menuName;
	}
	
	public void setMenuName(String menuName) {
		this.menuName = menuName;
	}
	
	@Transient
	public String getHandlePermissionIdentifier() {
		return handlePermissionIdentifier;
	}
	
	public void setHandlePermissionIdentifier(String handlePermissionIdentifier) {
		this.handlePermissionIdentifier = handlePermissionIdentifier;
	}
	
	@Transient
	public List<SysHandlePermissionsClasses> getClasses() {
		return classes;
	}
	
	public void setClasses(List<SysHandlePermissionsClasses> classes) {
		this.classes = classes;
	}
	
	@Transient
	public List<SysHandlePermissionsStyles> getStyles() {
		return styles;
	}
	
	public void setStyles(List<SysHandlePermissionsStyles> styles) {
		this.styles = styles;
	}
	
	@Transient
	public List<SysHandlePermissionsEvents> getEvents() {
		return events;
	}
	
	public void setEvents(List<SysHandlePermissionsEvents> events) {
		this.events = events;
	}
	
	@Transient
	public List<SysHandlePermissionsAttrs> getAttrs() {
		return attrs;
	}
	
	public void setAttrs(List<SysHandlePermissionsAttrs> attrs) {
		this.attrs = attrs;
	}
	
}